package com.tang.visitor.impl;

import com.tang.user.impl.Student;
import com.tang.user.impl.Teacher;
import com.tang.visitor.IVisitorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 访问者：校长
 */
public class PrincipalServiceImpl implements IVisitorService {

    private final Logger log = LoggerFactory.getLogger(this.getClass());

    // 校长看学生的姓名，班级
    @Override
    public void visit(Student student) {
        log.info("学生信息 姓名：{}， 班级：{}", student.name, student.clazz);
    }

    // 校长看老师的姓名，班级，升学率
    @Override
    public void visit(Teacher teacher) {
        log.info("学生信息 姓名：{}，班级：{}，升学率：{}", teacher.name, teacher.clazz, teacher.entranceRatio());
    }

}
